package com.wrz.controller;

import com.wrz.entity.User;
import com.wrz.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("list")
    public String list(Model model, String dept){
        List<User> list = userService.list(dept);
        model.addAttribute("list",list);
        model.addAttribute("dept",dept);
        return "list";
    }
}
